<template>
  <tool-page title="生成随机身份证号" :value="value" @generate="generate" :remark="remark">
    <template #buttonBefore>
      地区：
      <choose-area @change="onAreaChange"></choose-area>
    </template>
  </tool-page>
</template>

<script>
import ChooseArea from "@/components/ChooseArea";

export default {
  name: "RandIDCard",
  components: {ChooseArea},
  data() {
    return {
      value: '',
      areaCode: '',
      remark: '随机生成身份证号，你可以选择所在地'
    }
  },
  methods: {
    generate() {
      this.value = this.simpleUtils.randomIDCard(this.areaCode);
    },
    onAreaChange(val) {
      this.areaCode = val[2].code;
      this.generate();
    }
  },
  created() {
    this.generate();
  }
}
</script>

<style scoped>

</style>
